import java.awt.BasicStroke;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;
import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;

import javax.swing.JPanel;
import javax.swing.Timer;

public class ArmMovement {

	// ////// ARM ANGLE IN RADIANS
	private double l;
	private double r;

	public double getL() {
		return l;
	}

	public void setL(double l) {
		this.l = l;
	}

	public double getR() {
		return r;
	}

	public void setR(double r) {
		this.r = r;
	}

	// ////////
	public void drawArms(Graphics2D g2d) {

		Ellipse2D.Double armleft = new Ellipse2D.Double(234, 265, 35, 30); // 234
		g2d.setColor(Color.black);
//		g2d.fill(armleft);

		g2d.fill(rotateShape(armleft, l, 264, 270));

		
		

		Ellipse2D.Double armright = new Ellipse2D.Double(330, 265, 35, 30);
		g2d.setColor(Color.black);
		 //g2d.fill(armright);
		g2d.fill(rotateShape(armright, r, 330, 270));
	}

	public static Shape rotateShape(final Shape base, final double angle,
			final float x, final float y) {
		if (base == null) {
			return null;
		}
		final AffineTransform rotate = AffineTransform.getRotateInstance(angle,
				x, y);
		final Shape result = rotate.createTransformedShape(base);
		return result;
	}
	

	public int x = 200;
	public void testDraw(Graphics2D g2d){
		Ellipse2D.Double eyeleft = new Ellipse2D.Double(x, 210, 50, 50);

		g2d.setColor(Color.red);
		g2d.fill(eyeleft);

	}
}
